import java.util.Scanner;

public class Java024 {
    public static void main(String[] args) {
        int num = new Scanner(System.in).nextInt();
        digits(num);
        Reverse(num);
    }
    public static void digits(int num){
        int n=0;
        while(num>0){
            n++;
            num=num/10;
        }
        System.out.println(n);
    }
    public static void Reverse(int num){
        int n=0;
        while(num>0){
            n=num%10+n*10;
            num=num/10;
        }
        System.out.println(n);
    }
}
